package com.app.teaware.bean;


import com.alibaba.fastjson.annotation.JSONField;

import java.util.ArrayList;

public class MessageListBean extends BaseListBeanXF {

    private ArrayList<MessageListData> list = new ArrayList<MessageListData>();

    public ArrayList<MessageListData> getList() {
        return list;
    }

    public void setList(ArrayList<MessageListData> list) {
        this.list = list;
    }

    @JSONField(serialize = false)
    public void addListBean(MessageListBean listbean) {
        if (listbean == null)
            return;
        if (this.getCurrent() == INIT_PAGE) {
            setList(listbean.getList());
        } else {
            if (list == null)
                list = new ArrayList<MessageListData>();
            list.addAll(listbean.getList());
        }
        setListBeanData(listbean);
    }

    public void setAllRead(){
        for (MessageListData listData:list){
            listData.setReadStatus_READ();
        }
    }
}
